import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class mileage_regex {
    public static Long mileage(String s){
        String code = "0";
        Long min = 0L;
        long result = 0L;
        if(s!="" && s!=null) {
            Pattern pattern = Pattern.compile("([0-9]+)");
            Matcher matcher = pattern.matcher(s);


            if (matcher.find()) {
                code = matcher.group(1);


            }
        }
        min = Long.valueOf(code);
        if(min==0){
            result = 0l;
        }else if(min<10000L){
            result = 1L;
        }else if( min>=10000L && min<30000L ){
            result = 3L;
        }else if(min>=30000L && min<50000L){
            result = 5L;
        } else if(min>=50000L&& min<100000L){
            result = 10L;
        } else if(min>=100000L&& min<150000L){
            result = 15L;
        } else if(min>=150000L&& min<200000L){
            result = 20L;
        } else if(min>=200000L&& min<300000L){
            result = 30L;
        } else if(min>=300000L&& min<400000L){
            result = 40L;
        } else if(min>=400000L&& min<500000L){
            result = 50L;
        } else if(min>=500000L&& min<600000L){
            result = 60L;
        }else if(min>=600000L&& min<700000L){
            result = 70L;
        }else if(min>=700000L&& min<800000L){
            result = 80L;
        }else if(min>=800000L&& min<900000L){
            result = 90L;
        }else if(min>=900000L&& min<1000000L){
            result = 100L;
        }else if(min>=1000000L){
            result = 0l;
        }

        return result;
    }
}
